home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGNG_C
/
CUG187.LZH
/
DIRNXT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1986-02-21
|
2KB
|
46 lines
/*@*****************************************************/
/*@ */
/*@ dirnxt - search directory for next matching entry. */
/*@ */
/*@ Usage: dirnxt(dta); */
/*@ where dta is the DTA specified in a previous */
/*@ call to dirfst(). */
/*@ */
/*@ returns a pointer to the file in the DTA. */
/*@ */
/*@ an extern of dirret has the last return */
/*@ code from DOS. */
/*@ */
/*@ NOTE: You must not tamper with the DTA */
/*@ between dirfst() and dirnxt() calls. */
/*@ */
/*@*****************************************************/
extern unsigned _rax, _rbx, _rcx, _rdx, _rsi, _rdi, _res, _rds;
extern char _carryf, _zerof;
extern int dirret;
char *dirnxt(dta)
char *dta;
{
int sav_carry, sav_rax;
savedta(); /* save old dta */
setdta(dta); /* use caller's area */
dirret = 0; /* clear return code */
_rax = 0x4f00; /* DOS find first function */
_doint(0x21); /* call DOS */
sav_carry = _carryf;
sav_rax = _rax;
restdta(); /* reset to DOS's DTA */
if (!sav_carry)
return &dta[30];
else {
dirret = sav_rax; /* save return code */
return 0;
}
}